<?php

namespace Shop\AdminBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class ProductType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('name')
            ->add('description')
            ->add('price')
            ->add('originPrice')
            ->add('discount')
            ->add('detail')
            ->add('buyDetail')
            ->add('lifeTime')
            ->add('shopId')
            ->add('brandId')
            ->add('countSold')
            ->add('countAll')
            ->add('isDelete')
            ->add('minBuyCount')
            ->add('maxBuyCount')
            ->add('enableShopCart')
            ->add('enablePhoneVerify')
        ;
    }
    
    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Shop\AdminBundle\Entity\Product'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'shop_adminbundle_product';
    }
}
